package cn.rkylin.oms.aftersale.resend.service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.github.pagehelper.PageInfo;

import cn.rkylin.oms.aftersale.resend.domain.AfterSaleResend;
import cn.rkylin.oms.aftersale.resend.domain.AfterSaleResendSku;
import cn.rkylin.oms.aftersale.resend.vo.ResendVO;

/**
 * 类名:IAfterSaleResendService <br/>
 * 作用: 补发单服务层接口. <br/>
 * 创建原因: 补发单服务层接口. <br/>
 * 创建时间: 2017年10月16日 下午1:40:55 <br/>
 * 
 * @author suqiaohui
 * @version v1.0
 */
public interface IAfterSaleResendService {

    /**
     * getResendListByCondition:根据查询条件分页查询补发单数据. <br/>
     * 
     * @param page
     * @param length
     * @param queryParamVO
     * @return
     * @throws Exception
     */
    public PageInfo<ResendVO> getResendListByCondition(int page, int length, ResendVO queryParamVO) throws Exception;

    /**
     * getResendListById:根据补发单ID获取补发单.
     * 
     * @param resendId
     * @return
     * @throws Exception
     */
    public AfterSaleResend getResendById(String resendId) throws Exception;

    /**
     * cancelResend：取消补发单. <br/>
     * 
     * @param data
     * @return
     * @throws Exception
     */
    public String cancelResend(AfterSaleResend data) throws Exception;

    /**
     * cancelResendAfterCancelShiporder:取消补发单. <br/>
     * 
     * @param resendId
     * @throws Exception
     */
    public void cancelResendAfterCancelShiporder(String resendId) throws Exception;

    /**
     * auditResend:审核补发单
     * 
     * @param resend
     * @return
     * @throws Exception
     */
    public Map<String, Object> auditResend(ArrayList<String> resendIds) throws Exception;

    /**
     * checkResends：检查补发单，为强制审核做准备
     * 
     * @param resendIdList
     * @return
     * @throws Exception
     */
    public Map<String, String> checkResends(String resendIds) throws Exception;

    /**
     * 强制审核补发单
     * 
     * @param resend
     * @return
     * @throws Exception
     */
    public Map<String, Object> mandatoryAuditResend(String resendIds) throws Exception;

    /**
     * 保存补发单及其明细.
     * 
     * @param resendVO
     * @return
     * @throws Exception
     */
    public String saveResends(ResendVO resendVO) throws Exception;

    /**
     * completeResends：完成补发单<br/>
     * 成功则返回"完成补发单"<br/>
     * 失败则返回"完成失败，不存在此补发单"<br/>
     * 
     * @param resendCode
     * @return
     * @throws Exception
     */
    public String completeResends(String resendCode) throws Exception;

    /**
     * updateResends:修改补发单
     * 
     * @param resendCode
     * @return
     * @throws Exception
     */
    public int updateResends(ResendVO resend) throws Exception;

    /**
     * updateResendStatusAfterCancelShiporder:取消发货单后更改补发单状态
     * 
     * @param sourceId
     * @throws Exception
     */
    public void updateResendStatusAfterCancelShiporder(String sourceId) throws Exception;

    /**
     * getResendSku:根据补发单ID获取补发单明细.
     * 
     * @param resendId
     * @return
     */
    public List<AfterSaleResendSku> getResendSku(String resendId) throws Exception;

    /**
     * 根据查询条件查询补发单列表.
     * 
     * @param page
     * @param rows
     * @param param
     * @return
     * @throws Exception
     */
    public PageInfo<ResendVO> findByWhere(int page, int rows, ResendVO param) throws Exception;

    /**
     * 根据补发单商品id查询补发单明细
     * 
     * @param resendSkuId
     * @return
     * @throws Exception
     */
    public AfterSaleResendSku selectResendSkubyresendSkuId(String resendSkuId) throws Exception;

    /**
     * findCounts：补发的各种count
     * 
     * @param param
     * @return
     * @throws Exception
     */
    public List<ResendVO> findCounts(ResendVO param) throws Exception;

    /**
     * getResendDetailById：根据补发单id获取补发单
     * 
     * @param resendId
     * @return
     * @throws Exception
     */
    public ResendVO getResendDetailById(String resendId) throws Exception;

    /**
     * deleteResendbyID：删除补发单
     * 
     * @param resendIds
     * @return
     * @throws Exception
     */
    public String deleteResendbyID(String resendIds) throws Exception;
    
    public List<AfterSaleResend> findResendByOrderId(String orderId) throws Exception;
    
    /**
     * getUnGoingCount:获取进行中的单据信息 <br/>
     *
     * @author zhanghao
     * @param paramMap
     * @return
     * @throws Exception
     */
    int getUnGoingCount(Map<String, String> paramMap) throws Exception;

}
